class UmlBase:
    def __init__(self, xmi_type="") -> None:
        self.xmi_type: str = xmi_type
        self.xmi_id: str = ""

    def to_json(self) -> dict[str, object]:
        json: dict = {}
        json["xmi_type"] = self.xmi_type
        json["xmi_id"] = self.xmi_id
        return json

    def from_json(self, json: dict):
        if json is None:
            return
        
        self.xmi_type = json.get("xmi_type", "")
        self.xmi_id = json.get("xmi_id", "")
